package com.library.control.book;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;

import com.library.model.service.BookService;

public class BookDeleteController extends AbstractController {

	private BookService bookservice;
	
	
	public void setBookservice(BookService bookservice) {
		this.bookservice = bookservice;
	}


	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse arg1) throws Exception {
		String book=request.getParameter("book_id");
		bookservice.deleteBook(book);
		return new ModelAndView("deleteok");
	}

}
